#!/usr/local/bin/python
# -*- coding: utf-8 -*-
from models import Emprunt, Membre

def get_nb_emprunts(activite=None, item=None, membre=None, year=None, month=None):
    if activite:
        q = Emprunt.objects.filter(item__activite__label=activite)
    else:
        q = Emprunt.objects.all()
    if item: q = q.filter(item=item)
    if membre: q = q.filter(membre=membre)
    if year: q = q.filter(start__year=year)
    if month: q = q.filter(start__month=month)
    return q.count()

def get_nb_membres_actifs(activite=None, item=None, year=None, month=None):
    
    return 0